{%include file="index.header.tpl.php"%}
{%include file="index.left.tpl.php"%}
  <!--主要内容开始-->
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
          <div class="col-md-12">
              <div class="box box-info">
<link rel="stylesheet" type="text/css" href="static/css/fullcalendar.css">
<link rel="stylesheet" type="text/css" href="static/css/fancybox.css">
<style type="text/css">
#calendar{width:960px; margin:20px auto 10px auto}
.fancy{width:450px; height:auto}
.fancy h3{height:30px; line-height:30px; border-bottom:1px solid #d3d3d3; font-size:14px}
.fancy form{padding:10px}
.fancy p{height:28px; line-height:28px; padding:4px; color:#999}
.input{height:20px; line-height:20px; padding:2px; border:1px solid #d3d3d3; width:100px}
.btn{-webkit-border-radius: 3px;-moz-border-radius:3px;padding:5px 12px; cursor:pointer}
.btn_ok{background: #360;border: 1px solid #390;color:#fff}
.btn_cancel{background:#f0f0f0;border: 1px solid #d3d3d3; color:#666 }
.btn_del{background:#f90;border: 1px solid #f80; color:#fff }
.sub_btn{height:32px; line-height:32px; padding-top:6px; border-top:1px solid #f0f0f0; text-align:right; position:relative}
.sub_btn .del{position:absolute; left:2px}
</style>

<div id='calendar'></div>
              </div>
           </div>
        </div><!--row-->
        <!--row-->
    </section>
 </div>
  <!--主要内容结束-->

	<footer class="main-footer">
    <strong>Copyright &copy; {%$system_ini.baseset_name%} 版权所有</strong> All rights
    reserved.
  </footer>
</div>
<!-- ./wrapper -->


<!-- jQuery 2.2.0 -->
<script src='http://code.jquery.com/jquery-1.9.1.js'></script>
<!-- jQuery UI 1.11.4 -->
<script src="static/js/bootstrap.min.js"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<!-- Bootstrap 3.3.6 -->

<script src="static/js/select2.min.js"></script>
<!-- AdminLTE App -->
<script src="static/js/app.min.js"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<!-- AdminLTE for demo purposes -->
<script src="static/js/demo.js"></script>
<script src="static/js/jquery-ui.js"></script>
<script src="static/js/jquery-ui-timepicker-addon.js"></script>
<script src='static/js/fullcalendar.min.js'></script>
<script src='static/js/jquery.fancybox-1.3.1.pack.js'></script>
<script type="text/javascript">
$(function() {
	$('#calendar').fullCalendar({
		header: {
			left: 'prev,next today',
			center: 'title',
			right: 'month,agendaWeek,agendaDay'
		},
		editable: true,
		dragOpacity: {
			agenda: .5,
			'':.6
		},
		eventDrop: function(event,dayDelta,minuteDelta,allDay,revertFunc) {
			$.post("index.php?a=event.dodrag",{id:event.id,daydiff:dayDelta,minudiff:minuteDelta,allday:allDay},function(msg){
				if(msg!=1){
					alert(msg);
					revertFunc();
				}
			});
    	},
		
		 eventResize: function(event,dayDelta,minuteDelta,revertFunc) {
			$.post("index.php?a=event.doresize",{id:event.id,daydiff:dayDelta,minudiff:minuteDelta},function(msg){
				if(msg!=1){
					alert(msg);
					revertFunc();
				}
			});
    	},
		
		
		selectable: true,
		select: function( startDate, endDate, allDay, jsEvent, view ){
			var start =$.fullCalendar.formatDate(startDate,'yyyy-MM-dd');
			var end =$.fullCalendar.formatDate(endDate,'yyyy-MM-dd');
			$.fancybox({
				'type':'ajax',
				'href':'index.php?a=event.add&date='+start+'&end='+end
			});
		},
		
		
		events: 'index.php?a=event.getjson',
		dayClick: function(date, allDay, jsEvent, view) {
			var selDate =$.fullCalendar.formatDate(date,'yyyy-MM-dd');
			$.fancybox({
				'type':'ajax',
				'href':'index.php?a=event.add&date='+selDate
			});
    	},
		eventClick: function(calEvent, jsEvent, view) {
			$.fancybox({
				'type':'ajax',
				'href':'index.php?a=event.update&id='+calEvent.id
			});
		}
	});
	
});
</script>

</body>
</html>

